package com.ruoyi.user.controller;

import com.ruoyi.user.common.Result;
import com.ruoyi.user.entity.Merchant;
import com.ruoyi.user.service.MerchantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/merchant")
public class MerchantController {
    @Autowired
    private MerchantService merchantService;

    @PostMapping("/login")
    public Result login(@RequestBody Merchant merchant) {
        return merchantService.merchantLogin(merchant);
    }

    @PostMapping("/register")
    public Result register(@RequestBody Merchant merchant) {
        return merchantService.merchantRegister(merchant);
    }

    @PostMapping("/update")
    public Result update(@RequestBody Merchant merchant) {
        return merchantService.update(merchant);
    }

}
